package Lab02.test06;


public class Triangle {

   //构造函数
         Triangle() {
          }

         //：属性：三边，周长，面积，判断能否构成三角形。
          double length1;

   double length2;
   double length3;
   double high;
   double area;
   double perimeter;
   Boolean judge;
          //:周长，面积，修改三个边；
        //:面积
          double area() {
              high = ((double) (length1 + length2 + length3)) / 2;
             return (double) Math.sqrt(high * (high - length1) * (high - length2) * (high - length3));
         }
         //:周长

           double perimeter() {

              return (perimeter = length1 + length2 + length3);
          }

           //：修改三边。

          void judge() {

                     if (length1 + length2 < length3 || length1 + length3 < length2 || length2 + length3 < length1) {

                     System.out.println("不能构成三角形");

                       } else if (length1 + length2 > length3 || length1 + length3 > length2 || length2 + length3 > length1) {

                 System.out.println("构成三角形");

                          }

          }

}
